<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>数据分析必备知识点 | Python 数据分析学习目录</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../数据分析必备知识点/数据分析流程.html" />
    
    
    <link rel="prev" href="../Python可视化/绘图库-Matplotlib/6pylab.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="6"
        data-chapter-title="数据分析必备知识点"
        data-filepath="数据分析必备知识点/数据分析必备知识点汇集.md"
        data-basepath=".."
        data-revision="Wed Oct 24 2018 21:30:49 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        数据分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="Python数据分析序言/内容序言.html">
            
                
                    <a href="../Python数据分析序言/内容序言.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        Python数据分析内容
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2" data-path="python数据分析环境和工具/Python数据分析相关.html">
            
                
                    <a href="../python数据分析环境和工具/Python数据分析相关.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        python数据分析环境和工具
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="python数据分析环境和工具/1Python数据课程软件和环境安装.html">
            
                
                    <a href="../python数据分析环境和工具/1Python数据课程软件和环境安装.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        Python数据课程 软件和环境安装
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="python数据分析环境和工具/2python发行版.html">
            
                
                    <a href="../python数据分析环境和工具/2python发行版.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        python发行版
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="python数据分析环境和工具/5交互式编辑器-JupyterNotebook.html">
            
                
                    <a href="../python数据分析环境和工具/5交互式编辑器-JupyterNotebook.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        交互式编辑器-JupyterNotebook
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.3.1" data-path="python数据分析环境和工具/5.1Jupyter-notebook拓展应用.html">
            
                
                    <a href="../python数据分析环境和工具/5.1Jupyter-notebook拓展应用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.1.</b>
                        
                        Jupyter-notebook拓展应用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="python数据分析环境和工具/包和环境管理器：conda.html">
            
                
                    <a href="../python数据分析环境和工具/包和环境管理器：conda.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        包和环境管理器：conda
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.4.1" data-path="python数据分析环境和工具/pip和Virtualenv.html">
            
                
                    <a href="../python数据分析环境和工具/pip和Virtualenv.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.1.</b>
                        
                        pip和Virtualenv
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="python数据分析环境和工具/3Markdown.html">
            
                
                    <a href="../python数据分析环境和工具/3Markdown.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        标记语言：Markdown
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.5.1" data-path="python数据分析环境和工具/4Markdown语法.html">
            
                
                    <a href="../python数据分析环境和工具/4Markdown语法.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.1.</b>
                        
                        Markdown语法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5.2" data-path="python数据分析环境和工具/6Gitbook文档.html">
            
                
                    <a href="../python数据分析环境和工具/6Gitbook文档.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.2.</b>
                        
                        文档管理工具-Gitbook
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="数据分析库的初步认识/index.html">
            
                
                    <a href="../数据分析库的初步认识/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        数据分析库-Pandas
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="数据分析库的初步认识/Pandas创建.html">
            
                
                    <a href="../数据分析库的初步认识/Pandas创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        pandas
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="数据分析库的初步认识/Series创建.html">
            
                
                    <a href="../数据分析库的初步认识/Series创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        Series
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="数据分析库的初步认识/DataFrame创建.html">
            
                
                    <a href="../数据分析库的初步认识/DataFrame创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        DataFrame对象-创建
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" >
            
            <span><b>4.</b> 数据分析库的操作</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="数据分析库的操作/1DataFrame查询1-整体.html">
            
                
                    <a href="../数据分析库的操作/1DataFrame查询1-整体.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        DataFrame查询1-整体
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="数据分析库的操作/2DataFrame查询2-专用查询.html">
            
                
                    <a href="../数据分析库的操作/2DataFrame查询2-专用查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        DataFrame查询2-专用查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="数据分析库的操作/3DataFrame查询3-专有查询：过滤查询.html">
            
                
                    <a href="../数据分析库的操作/3DataFrame查询3-专有查询：过滤查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        DataFrame查询3-专有查询：过滤查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="数据分析库的操作/4Pandas对象的数据操作：增删改查.html">
            
                
                    <a href="../数据分析库的操作/4Pandas对象的数据操作：增删改查.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        Pandas对象的数据操作：增删改查
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.1" data-path="数据分析库的操作/5Pandas数据操作：其他操作.html">
            
                
                    <a href="../数据分析库的操作/5Pandas数据操作：其他操作.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.1.</b>
                        
                        Pandas数据操作：其他操作
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.2" data-path="数据分析库的操作/6Pandas数据存取.html">
            
                
                    <a href="../数据分析库的操作/6Pandas数据存取.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.2.</b>
                        
                        Pandas数据存取
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.3" data-path="数据分析库的操作/7Pandas数据运算.html">
            
                
                    <a href="../数据分析库的操作/7Pandas数据运算.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.3.</b>
                        
                        Pandas数据运算
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.3.1" data-path="数据分析库的操作/7.1Pandas数据运算拓展.html">
            
                
                    <a href="../数据分析库的操作/7.1Pandas数据运算拓展.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.3.1.</b>
                        
                        Pandas数据运算-拓展
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.4.4" data-path="数据分析库的操作/8Pandas分组聚合1.html">
            
                
                    <a href="../数据分析库的操作/8Pandas分组聚合1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.4.</b>
                        
                        Pandas分组聚合1
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.5" data-path="数据分析库的操作/9Pandas分组聚合2.html">
            
                
                    <a href="../数据分析库的操作/9Pandas分组聚合2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.5.</b>
                        
                        Pandas分组聚合2
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.6" data-path="数据分析库的操作/10Pandas数据规整-清理.html">
            
                
                    <a href="../数据分析库的操作/10Pandas数据规整-清理.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.6.</b>
                        
                        Pandas数据规整-清理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.7" data-path="数据分析库的操作/11Pandas数据规整-转换.html">
            
                
                    <a href="../数据分析库的操作/11Pandas数据规整-转换.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.7.</b>
                        
                        Pandas数据规整-转换
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.7.1" data-path="数据分析库的操作/14Pandas数据规整-转换-离散化和面元划分.html">
            
                
                    <a href="../数据分析库的操作/14Pandas数据规整-转换-离散化和面元划分.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.7.1.</b>
                        
                        离散化和面元划分
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.4.8" data-path="数据分析库的操作/16Pandas数据规整-合并.html">
            
                
                    <a href="../数据分析库的操作/16Pandas数据规整-合并.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.8.</b>
                        
                        Pandas数据规整-合并
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="数据分析库的操作/13Pandas数据规整-重塑和轴向旋转.html">
            
                
                    <a href="../数据分析库的操作/13Pandas数据规整-重塑和轴向旋转.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        Pandas数据规整-重塑和轴向旋转
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.5.1" data-path="数据分析库的操作/13.1透视表和交叉表.html">
            
                
                    <a href="../数据分析库的操作/13.1透视表和交叉表.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.1.</b>
                        
                        透视表和交叉表
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="Python可视化/绘图库-Matplotlib.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        Python可视化
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="Python可视化/绘图库-Matplotlib/Matplotlib常见图表.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/Matplotlib常见图表.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        基础：Matplotlib常见图表
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.1" data-path="Python可视化/绘图库-Matplotlib/Matplotlib常见设置和操作.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/Matplotlib常见设置和操作.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.1.</b>
                        
                        Matplotlib常见设置和操作
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="Python可视化/绘图库-Matplotlib/1Matplotlib-绘图区域.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/1Matplotlib-绘图区域.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        提升：绘图区域
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="Python可视化/绘图库-Matplotlib/2Matplotlib-图像组件.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/2Matplotlib-图像组件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        提升：绘图组件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="Python可视化/绘图库-Matplotlib/3Matplotlib-高级绘图.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/3Matplotlib-高级绘图.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        拓展：高级绘图
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="Python可视化/绘图库-Matplotlib/4数学计算展示图像.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/4数学计算展示图像.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        拓展：数学计算展示图像
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="Python可视化/绘图库-Matplotlib/5注意事项.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/5注意事项.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        拓展：注意事项
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="Python可视化/绘图库-Matplotlib/6pylab.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/6pylab.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        拓展：pylab
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="6" data-path="数据分析必备知识点/数据分析必备知识点汇集.html">
            
                
                    <a href="../数据分析必备知识点/数据分析必备知识点汇集.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        数据分析必备知识点
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7" data-path="数据分析必备知识点/数据分析流程.html">
            
                
                    <a href="../数据分析必备知识点/数据分析流程.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        数据分析流程
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >Python 数据分析学习目录</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x5B8C;&#x6574;&#x6570;&#x636E;&#x5206;&#x6790;&#x5FC5;&#x5907;&#x57FA;&#x672C;&#x77E5;&#x8BC6;&#x70B9;&#x6C47;&#x96C6;">&#x5B8C;&#x6574;&#x6570;&#x636E;&#x5206;&#x6790;&#x5FC5;&#x5907;&#x57FA;&#x672C;&#x77E5;&#x8BC6;&#x70B9;&#x6C47;&#x96C6;</h1>
<hr>
<h2 id="&#x8F7D;&#x5165;&#x548C;&#x914D;&#x7F6E;&#x5E38;&#x7528;&#x5E93;">&#x8F7D;&#x5165;&#x548C;&#x914D;&#x7F6E;&#x5E38;&#x7528;&#x5E93;</h2>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">import</span> matplotlib.pyplot <span class="hljs-keyword">as</span> plt
<span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd

plt.style.use(<span class="hljs-string">&apos;seaborn&apos;</span>)
plt.rcParams[<span class="hljs-string">&apos;font.family&apos;</span>] = [<span class="hljs-string">&apos;Arial Unicode MS&apos;</span>, <span class="hljs-string">&apos;Microsoft Yahei&apos;</span>, <span class="hljs-string">&apos;SimHei&apos;</span>, <span class="hljs-string">&apos;sans-serif&apos;</span>]
</code></pre>
<pre><code class="lang-python">plt.plot([<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">4</span>,<span class="hljs-number">2</span>])
</code></pre>
<pre><code>[&lt;matplotlib.lines.Line2D at 0x875f400&gt;]
</code></pre><p><img src="images/output_3_1.png" alt="png"></p>
<h2 id="&#x6570;&#x636E;&#x8F7D;&#x5165;">&#x6570;&#x636E;&#x8F7D;&#x5165;</h2>
<p>&#x5E38;&#x89C1;&#x6570;&#x636E;&#x5F62;&#x5F0F;</p>
<ul>
<li>CSV&#xFF1A;.csv</li>
<li>Excel&#xFF1A;.xslx</li>
</ul>
<pre><code class="lang-python"><span class="hljs-comment"># pd.read_csv(&apos;aaa.csv&apos;)  # &#x8F7D;&#x5165;csv</span>
shop = pd.read_excel(<span class="hljs-string">&apos;shopmall.xlsx&apos;</span>, <span class="hljs-keyword">None</span>)  <span class="hljs-comment"># &#x8F7D;&#x5165;Excel&#x6587;&#x6863;&#xFF0C;&#x6240;&#x6709;&#x5DE5;&#x4F5C;&#x8868;&#xFF0C;&#x4F7F;&#x7528;&#x7D22;&#x5F15;&#x67E5;&#x8BE2;&#x5BF9;&#x5E94;&#x8868;</span>
</code></pre>
<pre><code class="lang-python"><span class="hljs-comment"># &#x8F93;&#x51FA;&#x524D;5&#x884C;</span>
shop[<span class="hljs-string">&apos;&#x987E;&#x5BA2;&#x4FE1;&#x606F;&apos;</span>].head()
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>&#x5BA2;&#x6237;ID</th>
      <th>&#x767B;&#x9646;&#x6B21;&#x6570;</th>
      <th>&#x6CE8;&#x518C;&#x65F6;&#x95F4;(&#x8DDD;1970-1-1&#x7684;&#x79D2;&#x6570;)</th>
      <th>&#x672C;&#x6B21;&#x8D2D;&#x4E70;&#x65F6;&#x95F4;(&#x8DDD;1970-1-1&#x7684;&#x79D2;&#x6570;)</th>
      <th>&#x7ECF;&#x9A8C;&#x503C;</th>
      <th>&#x8BA2;&#x5355;&#x6570;</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>5245</td>
      <td>55</td>
      <td>1430413266</td>
      <td>1495339734</td>
      <td>206</td>
      <td>1</td>
    </tr>
    <tr>
      <th>1</th>
      <td>5254</td>
      <td>69</td>
      <td>1430413266</td>
      <td>1499041945</td>
      <td>428</td>
      <td>13</td>
    </tr>
    <tr>
      <th>2</th>
      <td>5286</td>
      <td>57</td>
      <td>1430413266</td>
      <td>1509936376</td>
      <td>280</td>
      <td>1</td>
    </tr>
    <tr>
      <th>3</th>
      <td>5292</td>
      <td>184</td>
      <td>1430413266</td>
      <td>1510135868</td>
      <td>643</td>
      <td>5</td>
    </tr>
    <tr>
      <th>4</th>
      <td>5474</td>
      <td>71</td>
      <td>1430413266</td>
      <td>1481185064</td>
      <td>61</td>
      <td>2</td>
    </tr>
  </tbody>
</table>
</div>



<h2 id="&#x67E5;&#x8BE2;&#x6570;&#x636E;">&#x67E5;&#x8BE2;&#x6570;&#x636E;</h2>
<pre><code class="lang-python">df = pd.DataFrame({
    <span class="hljs-string">&apos;name&apos;</span>: [<span class="hljs-string">&apos;&#x5F20;&#x4E09;&apos;</span>,<span class="hljs-string">&apos;&#x674E;&#x56DB;&apos;</span>,<span class="hljs-string">&apos;&#x738B;&#x4E94;&apos;</span>,<span class="hljs-string">&apos;&#x674E;&#x56DB;&apos;</span>,<span class="hljs-string">&apos;&#x738B;&#x4E94;&apos;</span>,<span class="hljs-string">&apos;&#x738B;&#x4E94;&apos;</span>,<span class="hljs-string">&apos;&#x8D75;&#x516D;&apos;</span>],
    <span class="hljs-string">&apos;chinese&apos;</span>:np.random.randint(<span class="hljs-number">35</span>,<span class="hljs-number">100</span>,<span class="hljs-number">7</span>),
    <span class="hljs-string">&apos;math&apos;</span>:np.random.randint(<span class="hljs-number">35</span>,<span class="hljs-number">100</span>,<span class="hljs-number">7</span>),
    <span class="hljs-string">&apos;english&apos;</span>:np.random.randint(<span class="hljs-number">35</span>,<span class="hljs-number">100</span>,<span class="hljs-number">7</span>),
    <span class="hljs-string">&apos;test&apos;</span>: [<span class="hljs-string">&apos;&#x4E00;&apos;</span>,<span class="hljs-string">&apos;&#x4E00;&apos;</span>,<span class="hljs-string">&apos;&#x4E00;&apos;</span>,<span class="hljs-string">&apos;&#x4E8C;&apos;</span>,<span class="hljs-string">&apos;&#x4E8C;&apos;</span>,<span class="hljs-string">&apos;&#x4E09;&apos;</span>,<span class="hljs-string">&apos;&#x4E00;&apos;</span>]
})

df
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>



<p>&#x68C0;&#x67E5;&#x6570;&#x636E;</p>
<p>&#x68C0;&#x67E5;&#x5217;&#x7F3A;&#x5931;&#x503C;&#xFF0C;&#x548C;&#x5217;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x662F;&#x5426;&#x6B63;&#x5E38;</p>
<pre><code class="lang-python">df.info()
</code></pre>
<pre><code>&lt;class &apos;pandas.core.frame.DataFrame&apos;&gt;
RangeIndex: 7 entries, 0 to 6
Data columns (total 5 columns):
name       7 non-null object
chinese    7 non-null int32
math       7 non-null int32
english    7 non-null int32
test       7 non-null object
dtypes: int32(3), object(2)
memory usage: 276.0+ bytes
</code></pre><h3 id="&#x5FEB;&#x901F;&#x7EDF;&#x8BA1;">&#x5FEB;&#x901F;&#x7EDF;&#x8BA1;</h3>
<p>&#x8BA1;&#x7B97;&#x6307;&#x6807;&#xFF0C;&#x53D1;&#x73B0;&#x5F02;&#x5E38;&#x503C;</p>
<pre><code class="lang-python">df.describe()
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>count</th>
      <td>7.000000</td>
      <td>7.000000</td>
      <td>7.000000</td>
    </tr>
    <tr>
      <th>mean</th>
      <td>53.285714</td>
      <td>62.000000</td>
      <td>56.142857</td>
    </tr>
    <tr>
      <th>std</th>
      <td>23.591766</td>
      <td>21.501938</td>
      <td>14.724453</td>
    </tr>
    <tr>
      <th>min</th>
      <td>35.000000</td>
      <td>37.000000</td>
      <td>41.000000</td>
    </tr>
    <tr>
      <th>25%</th>
      <td>36.000000</td>
      <td>51.000000</td>
      <td>42.000000</td>
    </tr>
    <tr>
      <th>50%</th>
      <td>43.000000</td>
      <td>54.000000</td>
      <td>55.000000</td>
    </tr>
    <tr>
      <th>75%</th>
      <td>63.000000</td>
      <td>73.000000</td>
      <td>70.000000</td>
    </tr>
    <tr>
      <th>max</th>
      <td>97.000000</td>
      <td>95.000000</td>
      <td>73.000000</td>
    </tr>
  </tbody>
</table>
</div>



<p>&#x8F93;&#x51FA;&#x524D;&#x51E0;&#x884C;</p>
<pre><code class="lang-python"><span class="hljs-comment">#&#x663E;&#x793A;&#x524D;&#x51E0;&#x884C;</span>
df.head()
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
  </tbody>
</table>
</div>



<h4 id="&#x67E5;&#x8BE2;&#x8868;&#x683C;&#x7D22;&#x5F15;&#x548C;&#x5F62;&#x72B6;">&#x67E5;&#x8BE2;&#x8868;&#x683C;&#x7D22;&#x5F15;&#x548C;&#x5F62;&#x72B6;</h4>
<pre><code class="lang-python">df.index  <span class="hljs-comment">#&#x884C;&#x7D22;&#x5F15;</span>
</code></pre>
<pre><code>RangeIndex(start=0, stop=7, step=1)
</code></pre><pre><code class="lang-python">df.columns  <span class="hljs-comment">#&#x5217;&#x7D22;&#x5F15;</span>
</code></pre>
<pre><code>Index([&apos;name&apos;, &apos;chinese&apos;, &apos;math&apos;, &apos;english&apos;, &apos;test&apos;], dtype=&apos;object&apos;)
</code></pre><pre><code class="lang-python">df.shape  <span class="hljs-comment">#&#x5F62;&#x72B6;</span>
</code></pre>
<pre><code>(7, 5)
</code></pre><h3 id="&#x7D22;&#x5F15;&#x67E5;&#x8BE2;&#x548C;&#x5207;&#x7247;&#x67E5;&#x8BE2;">&#x7D22;&#x5F15;&#x67E5;&#x8BE2;&#x548C;&#x5207;&#x7247;&#x67E5;&#x8BE2;</h3>
<pre><code class="lang-python">df[<span class="hljs-string">&apos;name&apos;</span>]  <span class="hljs-comment">#&#x67E5;&#x8BE2;&#x5355;&#x5217;</span>
</code></pre>
<pre><code>0    &#x5F20;&#x4E09;
1    &#x674E;&#x56DB;
2    &#x738B;&#x4E94;
3    &#x674E;&#x56DB;
4    &#x738B;&#x4E94;
5    &#x738B;&#x4E94;
6    &#x8D75;&#x516D;
Name: name, dtype: object
</code></pre><pre><code class="lang-python">df[[<span class="hljs-string">&apos;name&apos;</span>,<span class="hljs-string">&apos;test&apos;</span>]]  <span class="hljs-comment">#&#x67E5;&#x8BE2;&#x591A;&#x5217;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python"><span class="hljs-comment"># loc&#x65B9;&#x5F0F;  &#x7D22;&#x5F15;&#x67E5;&#x8BE2;  &#x81EA;&#x5B9A;&#x4E49;&#x7D22;&#x5F15;</span>
df.loc[:,<span class="hljs-string">&apos;name&apos;</span>]   <span class="hljs-comment">#&#x67E5;&#x8BE2;&#x5355;&#x5217;</span>
</code></pre>
<pre><code>0    &#x5F20;&#x4E09;
1    &#x674E;&#x56DB;
2    &#x738B;&#x4E94;
3    &#x674E;&#x56DB;
4    &#x738B;&#x4E94;
5    &#x738B;&#x4E94;
6    &#x8D75;&#x516D;
Name: name, dtype: object
</code></pre><pre><code class="lang-python">df.loc[[<span class="hljs-number">0</span>,<span class="hljs-number">2</span>], [<span class="hljs-string">&apos;name&apos;</span>,<span class="hljs-string">&apos;test&apos;</span>]]  <span class="hljs-comment">#&#x591A;&#x884C;&#x591A;&#x5217;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">df.loc[[<span class="hljs-number">2</span>, <span class="hljs-number">4</span>], [<span class="hljs-string">&apos;name&apos;</span>,<span class="hljs-string">&apos;english&apos;</span>]]   <span class="hljs-comment">#&#x95F4;&#x9694;&#x7684;&#x591A;&#x884C;&#x591A;&#x5217;&#xFF0C;&#x7D22;&#x5F15;&#x67E5;&#x8BE2;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>english</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>55</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>41</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python"><span class="hljs-comment"># &#x5207;&#x7247;&#x67E5;&#x8BE2;</span>

df.loc[<span class="hljs-number">1</span>:<span class="hljs-number">3</span>,<span class="hljs-string">&apos;name&apos;</span>:<span class="hljs-string">&apos;math&apos;</span>]  <span class="hljs-comment">#&#x8FDE;&#x7EED;&#x7684;&#x591A;&#x884C;&#x591A;&#x5217;&#x7684;&#x5207;&#x7247;&#x67E5;&#x8BE2;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>89</td>
    </tr>
  </tbody>
</table>
</div>



<p>&#x5E03;&#x5C14;&#x67E5;&#x8BE2;</p>
<p>&#x67E5;&#x8BE2;&#x6240;&#x6709;&#x8BED;&#x6587;&#x6210;&#x7EE9;&#x53CA;&#x683C;&#x540C;&#x5B66;&#x7684;&#x4FE1;&#x606F;</p>
<pre><code class="lang-python">df
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">df[<span class="hljs-string">&apos;chinese&apos;</span>] &gt;= <span class="hljs-number">60</span>
</code></pre>
<pre><code>0     True
1     True
2    False
3    False
4    False
5    False
6    False
Name: chinese, dtype: bool
</code></pre><pre><code class="lang-python">df[df[<span class="hljs-string">&apos;chinese&apos;</span>] &gt;= <span class="hljs-number">60</span>]
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>




<hr>
<h2 id="&#x7F3A;&#x5931;&#x503C;&#x548C;&#x7C7B;&#x578B;&#x8F6C;&#x6362;">&#x7F3A;&#x5931;&#x503C;&#x548C;&#x7C7B;&#x578B;&#x8F6C;&#x6362;</h2>
<p>&#x89C6;&#x56FE;&#x548C;&#x526F;&#x672C;</p>
<p>&#x76F4;&#x63A5;&#x590D;&#x5236;&#x89C6;&#x56FE;</p>
<pre><code class="lang-python">df2 = df.copy()   <span class="hljs-comment">#&#x526F;&#x672C;&#xFF0C;&#x4FEE;&#x6539;&#x65B0;&#x53D8;&#x91CF;&#x4E0D;&#x6539;&#x53D8;&#x539F;&#x503C;</span>
</code></pre>
<pre><code class="lang-python">df2
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>



<h3 id="&#x7F3A;&#x5931;&#x503C;&#x8868;&#x793A;">&#x7F3A;&#x5931;&#x503C;&#x8868;&#x793A;</h3>
<p>np.nan&#x7CFB;&#x7EDF;&#x5E95;&#x5C42;&#x662F;&#x6D6E;&#x70B9;&#x6570;</p>
<pre><code class="lang-python">df2.loc[<span class="hljs-number">3</span>,<span class="hljs-string">&apos;math&apos;</span>] = np.nan
df2
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54.0</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57.0</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51.0</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>NaN</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95.0</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37.0</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51.0</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">df2.rename(index={<span class="hljs-string">&apos;3&apos;</span>:<span class="hljs-number">7</span>})
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54.0</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57.0</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51.0</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>NaN</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95.0</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37.0</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51.0</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>



<h2 id="&#x7F3A;&#x5931;&#x503C;&#x586B;&#x5145;">&#x7F3A;&#x5931;&#x503C;&#x586B;&#x5145;</h2>
<p>fillna()</p>
<pre><code class="lang-python">df2.fillna(<span class="hljs-number">0</span>)
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54.0</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57.0</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51.0</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>0.0</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95.0</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37.0</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51.0</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>



<h2 id="&#x503C;&#x7C7B;&#x578B;&#x8F6C;&#x6362;">&#x503C;&#x7C7B;&#x578B;&#x8F6C;&#x6362;</h2>
<p>astype()</p>
<p>&#x5E38;&#x89C1;&#x7C7B;&#x578B;&#x6709;&#xFF1A; np.int,np.float</p>
<p>&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;&#x4E0D;&#x80FD;&#x8F6C;&#x4E3A;&#x6570;&#x503C;&#x578B;</p>
<pre><code class="lang-python">df2.loc[:,[<span class="hljs-string">&apos;chinese&apos;</span>,<span class="hljs-string">&apos;math&apos;</span>, <span class="hljs-string">&apos;english&apos;</span>]].fillna(<span class="hljs-number">0</span>).astype(np.int)
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>73</td>
      <td>54</td>
      <td>73</td>
    </tr>
    <tr>
      <th>1</th>
      <td>97</td>
      <td>57</td>
      <td>69</td>
    </tr>
    <tr>
      <th>2</th>
      <td>35</td>
      <td>51</td>
      <td>55</td>
    </tr>
    <tr>
      <th>3</th>
      <td>43</td>
      <td>0</td>
      <td>71</td>
    </tr>
    <tr>
      <th>4</th>
      <td>35</td>
      <td>95</td>
      <td>41</td>
    </tr>
    <tr>
      <th>5</th>
      <td>37</td>
      <td>37</td>
      <td>42</td>
    </tr>
    <tr>
      <th>6</th>
      <td>53</td>
      <td>51</td>
      <td>42</td>
    </tr>
  </tbody>
</table>
</div>




<hr>
<h1 id="&#x5206;&#x7EC4;&#x805A;&#x5408;">&#x5206;&#x7EC4;&#x805A;&#x5408;</h1>
<ul>
<li>&#x5206;&#x7EC4;&#xFF1A;groupby()</li>
<li>&#x805A;&#x5408;&#xFF1A;mean(),size()</li>
</ul>
<pre><code class="lang-python">df
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">x = df.groupby([<span class="hljs-string">&apos;name&apos;</span>, <span class="hljs-string">&apos;test&apos;</span>])[<span class="hljs-string">&apos;chinese&apos;</span>, <span class="hljs-string">&apos;math&apos;</span>].mean()
x
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th></th>
      <th>chinese</th>
      <th>math</th>
    </tr>
    <tr>
      <th>name</th>
      <th>test</th>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>&#x5F20;&#x4E09;</th>
      <th>&#x4E00;</th>
      <td>73</td>
      <td>54</td>
    </tr>
    <tr>
      <th rowspan="2" valign="top">&#x674E;&#x56DB;</th>
      <th>&#x4E00;</th>
      <td>97</td>
      <td>57</td>
    </tr>
    <tr>
      <th>&#x4E8C;</th>
      <td>43</td>
      <td>89</td>
    </tr>
    <tr>
      <th rowspan="3" valign="top">&#x738B;&#x4E94;</th>
      <th>&#x4E00;</th>
      <td>35</td>
      <td>51</td>
    </tr>
    <tr>
      <th>&#x4E09;</th>
      <td>37</td>
      <td>37</td>
    </tr>
    <tr>
      <th>&#x4E8C;</th>
      <td>35</td>
      <td>95</td>
    </tr>
    <tr>
      <th>&#x8D75;&#x516D;</th>
      <th>&#x4E00;</th>
      <td>53</td>
      <td>51</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">x = df.groupby([<span class="hljs-string">&apos;name&apos;</span>, <span class="hljs-string">&apos;test&apos;</span>])[<span class="hljs-string">&apos;chinese&apos;</span>, <span class="hljs-string">&apos;english&apos;</span>].size()
x
</code></pre>
<pre><code>name  test
&#x5F20;&#x4E09;    &#x4E00;       1
&#x674E;&#x56DB;    &#x4E00;       1
      &#x4E8C;       1
&#x738B;&#x4E94;    &#x4E00;       1
      &#x4E09;       1
      &#x4E8C;       1
&#x8D75;&#x516D;    &#x4E00;       1
dtype: int64
</code></pre><h2 id="&#x91CD;&#x5851;&#xFF0C;&#x8F74;&#x5411;&#x65CB;&#x8F6C;">&#x91CD;&#x5851;&#xFF0C;&#x8F74;&#x5411;&#x65CB;&#x8F6C;</h2>
<p>unstack()</p>
<pre><code class="lang-python">x.unstack()
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th>test</th>
      <th>&#x4E00;</th>
      <th>&#x4E09;</th>
      <th>&#x4E8C;</th>
    </tr>
    <tr>
      <th>name</th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>&#x5F20;&#x4E09;</th>
      <td>1.0</td>
      <td>NaN</td>
      <td>NaN</td>
    </tr>
    <tr>
      <th>&#x674E;&#x56DB;</th>
      <td>1.0</td>
      <td>NaN</td>
      <td>1.0</td>
    </tr>
    <tr>
      <th>&#x738B;&#x4E94;</th>
      <td>1.0</td>
      <td>1.0</td>
      <td>1.0</td>
    </tr>
    <tr>
      <th>&#x8D75;&#x516D;</th>
      <td>1.0</td>
      <td>NaN</td>
      <td>NaN</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python"><span class="hljs-comment"># &#x5B9E;&#x73B0;&#x4E00;&#x4E2A;&#x5B8C;&#x6574;&#x7684;&#x4EA4;&#x53C9;&#x8868;&#xFF1A; size</span>
df.groupby([<span class="hljs-string">&apos;name&apos;</span>,<span class="hljs-string">&apos;test&apos;</span>])[<span class="hljs-string">&apos;chinese&apos;</span>, <span class="hljs-string">&apos;math&apos;</span>].size().unstack().fillna(<span class="hljs-number">0</span>).astype(np.int)
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th>test</th>
      <th>&#x4E00;</th>
      <th>&#x4E09;</th>
      <th>&#x4E8C;</th>
    </tr>
    <tr>
      <th>name</th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>&#x5F20;&#x4E09;</th>
      <td>1</td>
      <td>0</td>
      <td>0</td>
    </tr>
    <tr>
      <th>&#x674E;&#x56DB;</th>
      <td>1</td>
      <td>0</td>
      <td>1</td>
    </tr>
    <tr>
      <th>&#x738B;&#x4E94;</th>
      <td>1</td>
      <td>1</td>
      <td>1</td>
    </tr>
    <tr>
      <th>&#x8D75;&#x516D;</th>
      <td>1</td>
      <td>0</td>
      <td>0</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python"><span class="hljs-comment"># &#x5B9E;&#x73B0;&#x900F;&#x89C6;&#x8868;:mean</span>
df.groupby([<span class="hljs-string">&apos;name&apos;</span>, <span class="hljs-string">&apos;test&apos;</span>])[<span class="hljs-string">&apos;chinese&apos;</span>, <span class="hljs-string">&apos;math&apos;</span>].mean().unstack().fillna(<span class="hljs-number">0</span>).astype(np.int)
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead tr th {
        text-align: left;
    }

    .dataframe thead tr:last-of-type th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr>
      <th></th>
      <th colspan="3" halign="left">chinese</th>
      <th colspan="3" halign="left">math</th>
    </tr>
    <tr>
      <th>test</th>
      <th>&#x4E00;</th>
      <th>&#x4E09;</th>
      <th>&#x4E8C;</th>
      <th>&#x4E00;</th>
      <th>&#x4E09;</th>
      <th>&#x4E8C;</th>
    </tr>
    <tr>
      <th>name</th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>&#x5F20;&#x4E09;</th>
      <td>73</td>
      <td>0</td>
      <td>0</td>
      <td>54</td>
      <td>0</td>
      <td>0</td>
    </tr>
    <tr>
      <th>&#x674E;&#x56DB;</th>
      <td>97</td>
      <td>0</td>
      <td>43</td>
      <td>57</td>
      <td>0</td>
      <td>89</td>
    </tr>
    <tr>
      <th>&#x738B;&#x4E94;</th>
      <td>35</td>
      <td>37</td>
      <td>35</td>
      <td>51</td>
      <td>37</td>
      <td>95</td>
    </tr>
    <tr>
      <th>&#x8D75;&#x516D;</th>
      <td>53</td>
      <td>0</td>
      <td>0</td>
      <td>51</td>
      <td>0</td>
      <td>0</td>
    </tr>
  </tbody>
</table>
</div>



<h2 id="&#x900F;&#x89C6;&#x8868;&#x65B9;&#x6CD5;&#xFF1A;&#x5E73;&#x5747;&#x503C;">&#x900F;&#x89C6;&#x8868;&#x65B9;&#x6CD5;&#xFF1A;&#x5E73;&#x5747;&#x503C;</h2>
<p>mean,len</p>
<pre><code class="lang-python">
<span class="hljs-comment"># &#x793A;&#x4F8B;&#xFF1A;</span>
tips.pivot_table([<span class="hljs-string">&apos;tip_pct&apos;</span>, <span class="hljs-string">&apos;size&apos;</span>], index=[<span class="hljs-string">&apos;time&apos;</span>, <span class="hljs-string">&apos;day&apos;</span>], columns=<span class="hljs-string">&apos;smoker&apos;</span>, margins=<span class="hljs-keyword">True</span>, aggfunc=len, fill_value=<span class="hljs-number">0</span>)
</code></pre>
<pre><code class="lang-python">df.pivot_table([<span class="hljs-string">&apos;chinese&apos;</span>, <span class="hljs-string">&apos;math&apos;</span>], index = <span class="hljs-string">&apos;name&apos;</span>, columns=<span class="hljs-string">&apos;test&apos;</span>, fill_value=<span class="hljs-number">0</span>)
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead tr th {
        text-align: left;
    }

    .dataframe thead tr:last-of-type th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr>
      <th></th>
      <th colspan="3" halign="left">chinese</th>
      <th colspan="3" halign="left">math</th>
    </tr>
    <tr>
      <th>test</th>
      <th>&#x4E00;</th>
      <th>&#x4E09;</th>
      <th>&#x4E8C;</th>
      <th>&#x4E00;</th>
      <th>&#x4E09;</th>
      <th>&#x4E8C;</th>
    </tr>
    <tr>
      <th>name</th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>&#x5F20;&#x4E09;</th>
      <td>73</td>
      <td>0</td>
      <td>0</td>
      <td>54</td>
      <td>0</td>
      <td>0</td>
    </tr>
    <tr>
      <th>&#x674E;&#x56DB;</th>
      <td>97</td>
      <td>0</td>
      <td>43</td>
      <td>57</td>
      <td>0</td>
      <td>89</td>
    </tr>
    <tr>
      <th>&#x738B;&#x4E94;</th>
      <td>35</td>
      <td>37</td>
      <td>35</td>
      <td>51</td>
      <td>37</td>
      <td>95</td>
    </tr>
    <tr>
      <th>&#x8D75;&#x516D;</th>
      <td>53</td>
      <td>0</td>
      <td>0</td>
      <td>51</td>
      <td>0</td>
      <td>0</td>
    </tr>
  </tbody>
</table>
</div>



<h2 id="&#x4EA4;&#x53C9;&#x8868;&#xFF1A;&#x4E2A;&#x6570;">&#x4EA4;&#x53C9;&#x8868;&#xFF1A;&#x4E2A;&#x6570;</h2>
<pre><code class="lang-python"><span class="hljs-comment"># &#x793A;&#x4F8B;</span>

pd.crosstab(tips.time, [tips.smoker, tips.day], margins=<span class="hljs-keyword">True</span>)
</code></pre>
<pre><code class="lang-python">pd.crosstab(df[<span class="hljs-string">&apos;name&apos;</span>],df[<span class="hljs-string">&apos;test&apos;</span>],margins = <span class="hljs-keyword">True</span>)
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th>test</th>
      <th>&#x4E00;</th>
      <th>&#x4E09;</th>
      <th>&#x4E8C;</th>
      <th>All</th>
    </tr>
    <tr>
      <th>name</th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>&#x5F20;&#x4E09;</th>
      <td>1</td>
      <td>0</td>
      <td>0</td>
      <td>1</td>
    </tr>
    <tr>
      <th>&#x674E;&#x56DB;</th>
      <td>1</td>
      <td>0</td>
      <td>1</td>
      <td>2</td>
    </tr>
    <tr>
      <th>&#x738B;&#x4E94;</th>
      <td>1</td>
      <td>1</td>
      <td>1</td>
      <td>3</td>
    </tr>
    <tr>
      <th>&#x8D75;&#x516D;</th>
      <td>1</td>
      <td>0</td>
      <td>0</td>
      <td>1</td>
    </tr>
    <tr>
      <th>All</th>
      <td>4</td>
      <td>1</td>
      <td>2</td>
      <td>7</td>
    </tr>
  </tbody>
</table>
</div>




<hr>
<h1 id="&#x8868;&#x683C;&#x64CD;&#x4F5C;">&#x8868;&#x683C;&#x64CD;&#x4F5C;</h1>
<p>&#x7D22;&#x5F15;&#x4FEE;&#x6539;</p>
<ul>
<li>&#x6DFB;&#x52A0;&#x548C;&#x5220;&#x9664;&#x884C;&#x7D22;&#x5F15;&#xFF1A;.set_index()</li>
<li>&#x884C;&#x7D22;&#x5F15;&#x8FD8;&#x539F;&#x4E3A;&#x5217;&#x6570;&#x636E;&#xFF1A;reset_index()</li>
<li>&#x4FEE;&#x6539;&#x884C;&#x5217;&#x7D22;&#x5F15;&#xFF1A;.rename()</li>
</ul>
<p>&#x6392;&#x5E8F;</p>
<ul>
<li>&#x6309;&#x503C;&#x6392;&#x5E8F;&#xFF1A;.sort_values()</li>
<li>&#x6309;&#x5217;&#x6392;&#x5E8F;&#xFF1A;.sort_index()</li>
</ul>
<h2 id="&#x6DFB;&#x52A0;&#x884C;&#x7D22;&#x5F15;">&#x6DFB;&#x52A0;&#x884C;&#x7D22;&#x5F15;</h2>
<pre><code class="lang-python">df
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">df.set_index(<span class="hljs-string">&apos;name&apos;</span>)  <span class="hljs-comment"># &#x5C06;1&#x5217;&#x6570;&#x636E;&#x8BBE;&#x4E3A;&#x884C;&#x7D22;&#x5F15;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
    <tr>
      <th>name</th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>&#x5F20;&#x4E09;</th>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>&#x674E;&#x56DB;</th>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>&#x738B;&#x4E94;</th>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>&#x674E;&#x56DB;</th>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>&#x738B;&#x4E94;</th>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>&#x738B;&#x4E94;</th>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>&#x8D75;&#x516D;</th>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">df.set_index(<span class="hljs-string">&apos;name&apos;</span>, append=<span class="hljs-keyword">True</span>)  <span class="hljs-comment"># &#x4FDD;&#x7559;&#x539F;&#x7D22;&#x5F15;&#xFF0C;&#x521B;&#x5EFA;&#x65B0;&#x7D22;&#x5F15;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th></th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
    <tr>
      <th></th>
      <th>name</th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <th>&#x5F20;&#x4E09;</th>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <th>&#x674E;&#x56DB;</th>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <th>&#x738B;&#x4E94;</th>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <th>&#x674E;&#x56DB;</th>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <th>&#x738B;&#x4E94;</th>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <th>&#x738B;&#x4E94;</th>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <th>&#x8D75;&#x516D;</th>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>



<h2 id="&#x884C;&#x7D22;&#x5F15;&#x8FD8;&#x539F;&#x4E3A;&#x6570;&#x636E;&#x5217;">&#x884C;&#x7D22;&#x5F15;&#x8FD8;&#x539F;&#x4E3A;&#x6570;&#x636E;&#x5217;</h2>
<pre><code class="lang-python">df.set_index(<span class="hljs-string">&apos;name&apos;</span>)
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
    <tr>
      <th>name</th>
      <th></th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>&#x5F20;&#x4E09;</th>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>&#x674E;&#x56DB;</th>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>&#x738B;&#x4E94;</th>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>&#x674E;&#x56DB;</th>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>&#x738B;&#x4E94;</th>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>&#x738B;&#x4E94;</th>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>&#x8D75;&#x516D;</th>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">df.set_index(<span class="hljs-string">&apos;name&apos;</span>).reset_index()  <span class="hljs-comment"># &#x884C;&#x7D22;&#x5F15;&#x8FD8;&#x539F;&#x4E3A;&#x5217;&#x6570;&#x636E;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">df.set_index(<span class="hljs-string">&apos;name&apos;</span>).reset_index(drop=<span class="hljs-keyword">True</span>)  <span class="hljs-comment"># drop=True,&#x5220;&#x6389;&#x884C;&#x7D22;&#x5F15;&#x5217;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>



<h2 id="&#x4FEE;&#x6539;&#x884C;&#x5217;&#x7D22;&#x5F15;">&#x4FEE;&#x6539;&#x884C;&#x5217;&#x7D22;&#x5F15;</h2>
<pre><code class="lang-python">df.rename(index={<span class="hljs-number">0</span>: <span class="hljs-string">&apos;aaa&apos;</span>, <span class="hljs-number">1</span>: <span class="hljs-string">&apos;bbb&apos;</span>}, columns={<span class="hljs-string">&apos;chinese&apos;</span>: <span class="hljs-string">&apos;&#x8BED;&#x6587;&apos;</span>})
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>&#x8BED;&#x6587;</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>aaa</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>bbb</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>



<h1 id="&#x6392;&#x5E8F;">&#x6392;&#x5E8F;</h1>
<h2 id="&#x6309;&#x7D22;&#x5F15;&#x6392;&#x5E8F;">&#x6309;&#x7D22;&#x5F15;&#x6392;&#x5E8F;</h2>
<pre><code class="lang-python">df.sort_index()  <span class="hljs-comment"># &#x6309;&#x884C;&#x7D22;&#x5F15;&#x6392;&#x5E8F;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">df.sort_index(axis=<span class="hljs-number">1</span>, ascending=<span class="hljs-keyword">False</span>)  <span class="hljs-comment"># &#x6309;&#x5217;&#x7D22;&#x5F15;&#x6392;&#x5E8F;&#xFF0C;&#x5012;&#x5E8F;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>test</th>
      <th>name</th>
      <th>math</th>
      <th>english</th>
      <th>chinese</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x4E00;</td>
      <td>&#x5F20;&#x4E09;</td>
      <td>54</td>
      <td>73</td>
      <td>73</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x4E00;</td>
      <td>&#x674E;&#x56DB;</td>
      <td>57</td>
      <td>69</td>
      <td>97</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x4E00;</td>
      <td>&#x738B;&#x4E94;</td>
      <td>51</td>
      <td>55</td>
      <td>35</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x4E8C;</td>
      <td>&#x674E;&#x56DB;</td>
      <td>89</td>
      <td>71</td>
      <td>43</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x4E8C;</td>
      <td>&#x738B;&#x4E94;</td>
      <td>95</td>
      <td>41</td>
      <td>35</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x4E09;</td>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>42</td>
      <td>37</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x4E00;</td>
      <td>&#x8D75;&#x516D;</td>
      <td>51</td>
      <td>42</td>
      <td>53</td>
    </tr>
  </tbody>
</table>
</div>



<h2 id="&#x6309;&#x503C;&#x6392;&#x5E8F;">&#x6309;&#x503C;&#x6392;&#x5E8F;</h2>
<pre><code class="lang-python">df.sort_values(by=<span class="hljs-string">&apos;chinese&apos;</span>, ascending=<span class="hljs-keyword">False</span>)
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">df.sort_values(<span class="hljs-string">&apos;chinese&apos;</span>, ascending=<span class="hljs-keyword">False</span>)
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
  </tbody>
</table>
</div>




<hr>
<p>&#x5408;&#x5E76;&#x8868;&#x683C;</p>
<p>merge </p>
<p>&#x6309;&#x5217;&#x5408;&#x5E76;</p>
<pre><code class="lang-python">pd.merge(df,df2,left_on=<span class="hljs-string">&apos;name&apos;</span>, right_index=<span class="hljs-keyword">True</span>) <span class="hljs-comment">#&#x5408;&#x5E76;&#x8868;&#xFF0C;&#x5DE6;&#x8868;&#x5408;&#x5E76;&#x57FA;&#x51C6;&#x662F;name&#x5217;&#xFF0C;&#x53F3;&#x8868;&#x5408;&#x5E76;&#x57FA;&#x51C6;&#x662F;&#x884C;&#x7D22;&#x5F15;</span>
</code></pre>
<pre><code class="lang-python">df
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">df3 = pd.DataFrame(df[<span class="hljs-string">&apos;name&apos;</span>].loc[[<span class="hljs-number">0</span>,<span class="hljs-number">6</span>]])  <span class="hljs-comment">#&#x62BD;&#x53D6;&#x4E00;&#x5217;&#x7684;2&#x884C;&#x503C;&#xFF0C;&#x8F6C;&#x4E3A;&#x8868;&#x683C;</span>
df3[<span class="hljs-string">&apos;&#x601D;&#x60F3;&apos;</span>] = [<span class="hljs-number">50</span>,<span class="hljs-number">90</span>]   <span class="hljs-comment">#&#x589E;&#x52A0;1&#x5217;</span>
df3 = df3.set_index(<span class="hljs-string">&apos;name&apos;</span>)  <span class="hljs-comment">#&#x6570;&#x636E;&#x5217;&#x8BBE;&#x4E3A;&#x884C;&#x7D22;&#x5F15;</span>
df3
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>&#x601D;&#x60F3;</th>
    </tr>
    <tr>
      <th>name</th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>&#x5F20;&#x4E09;</th>
      <td>50</td>
    </tr>
    <tr>
      <th>&#x8D75;&#x516D;</th>
      <td>90</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python"><span class="hljs-comment">#&#x5408;&#x5E76;&#x8868;</span>
<span class="hljs-comment">#&#x5DE6;&#x8FB9;&#x8868;&#xFF0C;&#x53F3;&#x8FB9;&#x8868;&#xFF0C;&#x5DE6;&#x8868;&#x5408;&#x5E76;&#x57FA;&#x51C6;&#xFF0C;&#x53F3;&#x8FB9;&#x5408;&#x5E76;&#x57FA;&#x51C6;</span>

pd.merge(df,df3,left_on=<span class="hljs-string">&apos;name&apos;</span>,right_index=<span class="hljs-keyword">True</span>)  <span class="hljs-comment">#&#x9ED8;&#x8BA4;&#xFF1A;&#x4EA4;&#x96C6;</span>
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
      <th>&#x601D;&#x60F3;</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
      <td>50</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
      <td>90</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python"><span class="hljs-comment">#&#x4F7F;&#x7528;&#x53C2;&#x6570; how=inner/outer/left/right  &#x53EF;&#x4EE5;&#x5206;&#x522B;&#x8FD4;&#x56DE;&#x4EA4;&#x96C6;&#xFF0C;&#x5E76;&#x96C6;&#xFF0C;&#x5BF9;&#x8C61;1&#x6709;&#x7684;&#x884C;&#xFF0C;&#x5BF9;&#x8C61;2 &#x6709;&#x7684;&#x884C;</span>
pd.merge(df,df3,left_on=<span class="hljs-string">&apos;name&apos;</span>,right_index=<span class="hljs-keyword">True</span>,how=<span class="hljs-string">&apos;outer&apos;</span>).fillna(<span class="hljs-number">0</span>)
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
      <th>&#x601D;&#x60F3;</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
      <td>50.0</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
      <td>0.0</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
      <td>0.0</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
      <td>0.0</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
      <td>0.0</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
      <td>0.0</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
      <td>90.0</td>
    </tr>
  </tbody>
</table>
</div>



<hr>
<h2 id="pandas-&#x7ED8;&#x56FE;-&#x7ED3;&#x5408;matplotlib">Pandas &#x7ED8;&#x56FE; (&#x7ED3;&#x5408;Matplotlib)</h2>
<p>&#x67F1;&#x72B6;&#x56FE;</p>
<pre><code class="lang-python">df
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x5F20;&#x4E09;</td>
      <td>73</td>
      <td>54</td>
      <td>73</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>51</td>
      <td>55</td>
      <td>&#x4E00;</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x674E;&#x56DB;</td>
      <td>43</td>
      <td>89</td>
      <td>71</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>4</th>
      <td>&#x738B;&#x4E94;</td>
      <td>35</td>
      <td>95</td>
      <td>41</td>
      <td>&#x4E8C;</td>
    </tr>
    <tr>
      <th>5</th>
      <td>&#x738B;&#x4E94;</td>
      <td>37</td>
      <td>37</td>
      <td>42</td>
      <td>&#x4E09;</td>
    </tr>
    <tr>
      <th>6</th>
      <td>&#x8D75;&#x516D;</td>
      <td>53</td>
      <td>51</td>
      <td>42</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">df.plot.bar()
</code></pre>
<pre><code>&lt;matplotlib.axes._subplots.AxesSubplot at 0x8c38630&gt;
</code></pre><p><img src="images/output_81_1.png" alt="png"></p>
<pre><code class="lang-python">df.plot.bar(
    figsize = (<span class="hljs-number">18</span>,<span class="hljs-number">10</span>),  <span class="hljs-comment">#&#x5927;&#x5C0F;</span>
    alpha = <span class="hljs-number">0.7</span>,  <span class="hljs-comment">#&#x900F;&#x660E;&#x5EA6;</span>
    stacked = <span class="hljs-keyword">True</span>,  <span class="hljs-comment">#stacked = True &#x5806;&#x79EF;(&#x7D2F;&#x8BA1;)&#x67F1;&#x72B6;&#x56FE;</span>
)
plt.title(<span class="hljs-string">&apos;&#x6211;&#x662F;&#x6807;&#x9898;&apos;</span>,fontsize = <span class="hljs-number">36</span>)
plt.xticks(df.index,[<span class="hljs-string">&apos;&#x4E00;&apos;</span>,<span class="hljs-string">&apos;&#x4E8C;&apos;</span>,<span class="hljs-string">&apos;&#x4E09;&apos;</span>,<span class="hljs-string">&apos;&#x56DB;&apos;</span>,<span class="hljs-string">&apos;&#x4E94;&apos;</span>,<span class="hljs-string">&apos;&#x516D;&apos;</span>,<span class="hljs-string">&apos;&#x4E03;&apos;</span>,])
</code></pre>
<pre><code>([&lt;matplotlib.axis.XTick at 0xa805d30&gt;,
  &lt;matplotlib.axis.XTick at 0xa8055c0&gt;,
  &lt;matplotlib.axis.XTick at 0xa833978&gt;,
  &lt;matplotlib.axis.XTick at 0xa827b00&gt;,
  &lt;matplotlib.axis.XTick at 0x9453320&gt;,
  &lt;matplotlib.axis.XTick at 0x9453860&gt;,
  &lt;matplotlib.axis.XTick at 0x9453da0&gt;],
 &lt;a list of 7 Text xticklabel objects&gt;)
</code></pre><p><img src="images/output_82_1.png" alt="png"></p>
<h2 id="numpy&#x7684;npwhere&#x65B9;&#x6CD5;&#x548C;python&#x4E09;&#x5143;&#x8868;&#x8FBE;&#x5F0F;">Numpy&#x7684;np.where&#x65B9;&#x6CD5;&#x548C;Python&#x4E09;&#x5143;&#x8868;&#x8FBE;&#x5F0F;</h2>
<p><code>np.where</code>&#x65B9;&#x6CD5;&#x662F;&#x4E09;&#x5143;&#x8868;&#x8FBE;&#x5F0F; <code>x if condition else y</code> &#x7684;&#x77E2;&#x91CF;&#x5316;&#x7248;&#x672C;</p>
<p>&#x4E09;&#x5143;&#x8868;&#x8FBE;&#x5F0F;</p>
<p>&#x6761;&#x4EF6;&#x4E3A;&#x771F;&#x65F6;&#x7684;&#x7ED3;&#x679C; if &#x5224;&#x5B9A;&#x6761;&#x4EF6; else &#x6761;&#x4EF6;&#x4E3A;&#x5047;&#x65F6;&#x7684;&#x7ED3;&#x679C;</p>
<pre><code class="lang-python"><span class="hljs-keyword">if</span> <span class="hljs-number">1</span> &lt; <span class="hljs-number">0</span>:
    y = <span class="hljs-number">1</span>
<span class="hljs-keyword">else</span>:
    y = <span class="hljs-number">0</span>

y
</code></pre>
<pre><code>0
</code></pre><pre><code class="lang-python"><span class="hljs-comment"># &#x6548;&#x679C;&#x540C;&#x4E0A;</span>
result = <span class="hljs-number">1</span> <span class="hljs-keyword">if</span> <span class="hljs-number">1</span> &lt; <span class="hljs-number">0</span> <span class="hljs-keyword">else</span> <span class="hljs-number">0</span>
result
</code></pre>
<pre><code>0
</code></pre><h3 id="npwhere">np.where</h3>
<ul>
<li><p>result2 = np.where(&#x6761;&#x4EF6;, a, b)</p>
</li>
<li><p>&#x5F53;&#x6761;&#x4EF6;&#x4E3A;&#x771F;&#x65F6;&#x8FD4;&#x56DE;a&#xFF0C;&#x4E3A;&#x5047;&#x65F6;&#x8FD4;&#x56DE;b</p>
</li>
</ul>
<p>&#x5E38;&#x7528;&#x4E8E;&#x6839;&#x636E;&#x4E00;&#x4E2A;&#x6570;&#x7EC4;&#x4EA7;&#x751F;&#x53E6;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x6570;&#x7EC4;</p>
<h4 id="&#x4F8B;&#x5B50;&#xFF1A;-&#x8F93;&#x51FA;&#x65B0;&#x6570;&#x636E;&#xFF0C;&#x8BED;&#x6587;&#x6210;&#x7EE9;&#x53CA;&#x683C;&#x4E3A;1&#xFF0C;&#x4E0D;&#x53CA;&#x683C;&#x4E3A;0">&#x4F8B;&#x5B50;&#xFF1A; &#x8F93;&#x51FA;&#x65B0;&#x6570;&#x636E;&#xFF0C;&#x8BED;&#x6587;&#x6210;&#x7EE9;&#x53CA;&#x683C;&#x4E3A;1&#xFF0C;&#x4E0D;&#x53CA;&#x683C;&#x4E3A;0.</h4>
<pre><code class="lang-python">df[<span class="hljs-string">&apos;chinese&apos;</span>]
</code></pre>
<pre><code>0    73
1    97
2    35
3    43
4    35
5    37
6    53
Name: chinese, dtype: int32
</code></pre><pre><code class="lang-python">df[<span class="hljs-string">&apos;chinese&apos;</span>] &gt;= <span class="hljs-number">60</span>
</code></pre>
<pre><code>0     True
1     True
2    False
3    False
4    False
5    False
6    False
Name: chinese, dtype: bool
</code></pre><pre><code class="lang-python">z2 = np.where(df[<span class="hljs-string">&apos;chinese&apos;</span>] &gt;= <span class="hljs-number">60</span>,<span class="hljs-number">1</span>,<span class="hljs-number">0</span> )
z2
</code></pre>
<pre><code>array([1, 1, 0, 0, 0, 0, 0])
</code></pre><hr>
<h1 id="&#x81EA;&#x5B9A;&#x4E49;&#x51FD;&#x6570;">&#x81EA;&#x5B9A;&#x4E49;&#x51FD;&#x6570;</h1>
<p>.apply()</p>
<p>&#x7528;&#x5728;&#x4EC0;&#x4E48;&#x5730;&#x65B9;&#xFF1A;</p>
<pre><code>&#x5F53;&#x4F60;&#x60F3;&#x8981;&#x6267;&#x884C;&#x4E00;&#x4E2A;&#x6570;&#x636E;&#x64CD;&#x4F5C;&#x65F6;&#xFF0C;&#x9996;&#x5148;&#x8003;&#x8651;&#xFF0C;&#x80FD;&#x5426;&#x4F7F;&#x7528;pandas&#x81EA;&#x5E26;&#x7684;&#x65B9;&#x6CD5;&#x5B9E;&#x73B0;&#x3002;&#x5982;&#x679C;&#x4E0D;&#x80FD;&#x5B9E;&#x73B0;&#xFF0C;&#x5C31;&#x81EA;&#x5B9A;&#x4E49;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#x7528;apply&#x8C03;&#x7528;&#x81EA;&#x5B9A;&#x4E49;&#x51FD;&#x6570;&#x5B9E;&#x73B0;&#x6548;&#x679C;&#x3002;
</code></pre><h1 id="&#x5982;&#x679C;&#x4E0D;&#x65B9;&#x4FBF;&#x7528;&#x81EA;&#x5B9A;&#x4E49;&#x51FD;&#x6570;&#xFF0C;&#x90A3;&#x5C31;&#x4F7F;&#x7528;for&#x5FAA;&#x73AF;&#x904D;&#x5386;">&#x5982;&#x679C;&#x4E0D;&#x65B9;&#x4FBF;&#x7528;&#x81EA;&#x5B9A;&#x4E49;&#x51FD;&#x6570;&#xFF0C;&#x90A3;&#x5C31;&#x4F7F;&#x7528;for&#x5FAA;&#x73AF;&#x904D;&#x5386;</h1>
<h3 id="&#x4F8B;&#xFF1A;&#x67E5;&#x8BE2;&#x8BED;&#x6587;&#x6210;&#x7EE9;&#x7B49;&#x4E8E;97&#x5206;&#x7684;&#x540C;&#x5B66;&#x4FE1;&#x606F;">&#x4F8B;&#xFF1A;&#x67E5;&#x8BE2;&#x8BED;&#x6587;&#x6210;&#x7EE9;&#x7B49;&#x4E8E;97&#x5206;&#x7684;&#x540C;&#x5B66;&#x4FE1;&#x606F;</h3>
<pre><code class="lang-python">df[<span class="hljs-string">&apos;chinese&apos;</span>] == <span class="hljs-number">97</span>
</code></pre>
<pre><code>0    False
1     True
2    False
3    False
4    False
5    False
6    False
Name: chinese, dtype: bool
</code></pre><p>&#x4F7F;&#x7528;pandas&#x539F;&#x751F;&#x65B9;&#x6CD5;&#x5B9E;&#x73B0;</p>
<pre><code class="lang-python">df[df[<span class="hljs-string">&apos;chinese&apos;</span>] == <span class="hljs-number">97</span>]
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>



<p>&#x4F7F;&#x7528;&#x81EA;&#x5B9A;&#x4E49;&#x51FD;&#x6570;&#x5B9E;&#x73B0;</p>
<pre><code class="lang-python"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">aaa</span><span class="hljs-params">(x)</span>:</span>
<span class="hljs-comment">#     if x == 97:</span>
<span class="hljs-comment">#         return True</span>
<span class="hljs-comment">#     return False</span>
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">True</span> <span class="hljs-keyword">if</span> x == <span class="hljs-number">97</span> <span class="hljs-keyword">else</span> <span class="hljs-keyword">False</span>
df[<span class="hljs-string">&apos;chinese&apos;</span>].apply(aaa)
</code></pre>
<pre><code>0    False
1     True
2    False
3    False
4    False
5    False
6    False
Name: chinese, dtype: bool
</code></pre><pre><code class="lang-python">df[df[<span class="hljs-string">&apos;chinese&apos;</span>].apply(aaa)]
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>chinese</th>
      <th>math</th>
      <th>english</th>
      <th>test</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x674E;&#x56DB;</td>
      <td>97</td>
      <td>57</td>
      <td>69</td>
      <td>&#x4E00;</td>
    </tr>
  </tbody>
</table>
</div>



                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../Python可视化/绘图库-Matplotlib/6pylab.html" class="navigation navigation-prev " aria-label="Previous page: 拓展：pylab"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../数据分析必备知识点/数据分析流程.html" class="navigation navigation-next " aria-label="Next page: 数据分析流程"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
